<?php
// define path to simpletest here
define('SIMPLETEST_PATH', realpath('./simpletest'));
define('OAUTHSIMPLE_PATH', realpath('../lib/OAuthSimple/php'));
define('PHLIX_PATH', realpath('../lib'));
define('TESTCASE_PATH', realpath('../tests'));
define('TESTFILE_PATH', realpath('../tests/files'));

// simpletest is php4-compatible and so causes "deprecated" errors
error_reporting(E_ALL & ~E_DEPRECATED);
ini_set('display_errors', 'On');

// establish include path
set_include_path(
    PHLIX_PATH . PATH_SEPARATOR .
    TESTCASE_PATH . PATH_SEPARATOR .
    SIMPLETEST_PATH . PATH_SEPARATOR .
    OAUTHSIMPLE_PATH . PATH_SEPARATOR .
    get_include_path()
);

// require convenience functions
require_once 'convenience.php';

// require necessary simpletest files
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/reporter.php';
require_once 'simpletest/mock_objects.php';

// create mocks
Mock::generate('OAuth_Request');
Mock::generate('OAuth_Response');

// add tests cases to group and run the tests
$test = new GroupTest('Core Phlix Tests');
$test->addTestCase(new UnitTestCase_Phlix);
$test->addTestCase(new UnitTestCase_OAuth);
$test->addTestCase(new UnitTestCase_OAuth_Uri);
$test->addTestCase(new UnitTestCase_OAuth_Request);
$test->addTestCase(new UnitTestCase_OAuth_Client);

// this class probably isn't even needed
$test->addTestCase(new UnitTestCase_Phlix_Options);
$test->run(new HtmlReporter());
